package com.chenbei.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chenbei.common.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDate;

@EqualsAndHashCode(callSuper = true)
@TableName("erp_batches")
@Data
@Schema(description = "批次")
public class Batches extends BaseEntity {

    @Schema(description = "主键ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "批次号")
    private String code;

    @Schema(description = "供应商")
    @TableField("supplier_id")
    @NotNull(message = "供应商不能为空")
    private Long supplierId;

    @Schema(description = "产品ID")
    @TableField("product_id")
    @NotNull(message = "产品ID不能为空")
    private Long productId;

    @Schema(description = "生产日期")
    @TableField("production_date")
    @NotNull(message = "生产日期不能为空")
    private LocalDate productionDate;

    @Schema(description = "过期日期")
    @TableField("expiry_date")
    @NotNull(message = "过期日期不能为空")
    private LocalDate expiryDate;

    @Schema(description = "数量")
    @NotNull(message = "数量不能为空")
    private Integer quantity;

    @Schema(description = "产品所属仓位")
    @TableField("storage_location_id")
    @NotNull(message = "所属仓位不能为空")
    private Long StorageLocationId;

    @Schema(description = "状态[1:可用|2:已分配|3:已出库]")
    private Integer status;
}
